package wait.notify.university.lessons;

import java.util.Random;
import java.util.concurrent.TimeUnit;

public class Producer implements Runnable {

	private Store store=null;
	
	public Producer(Store store) {
		super();
		this.store = store;
	}
	
	public void run() {
		while(true){
			int x=new Random().nextInt(10);
			store.put(x);
			System.out.println(Thread.currentThread().getName()+"^_^Has Put"+x);
			try {
				TimeUnit.MICROSECONDS.sleep(100);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}



}
